////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Microsoft Corporation.  All rights reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
// Portinos Copyright (c) 2012 Kentaro Sekimoto  All rights reserved.
////////////////////////////////////////////////////////////////////////////

#include "tinyhal.h"
#include "KS_MB9BF568_touchpanel_driver.h"

//--//

BOOL TOUCH_PANEL_Driver_Enable(GPIO_INTERRUPT_SERVICE_ROUTINE touchIsrProc)
{
    return KS_MB9BF568_TouchPanel_Driver::Initialize(touchIsrProc);
}

BOOL TOUCH_PANEL_Driver_Disable()
{
    return KS_MB9BF568_TouchPanel_Driver::Uninitialize();
}

void TOUCH_PANEL_Driver_GetPoint(TOUCH_PANEL_SAMPLE_FLAGS* pTipState, int* pSource, int* pUnCalX, int* pUnCalY)
{
    KS_MB9BF568_TouchPanel_Driver::GetPoint(pTipState, pSource, pUnCalY, pUnCalX);
}

HRESULT TOUCH_PANEL_Driver_GetDeviceCaps(unsigned int iIndex, void* lpOutput)
{
    return KS_MB9BF568_TouchPanel_Driver::GetDeviceCaps(iIndex, lpOutput);
}

BOOL HAL_TOUCH_PANEL_Enable(GPIO_INTERRUPT_SERVICE_ROUTINE touchIsrProc)
{
    return TOUCH_PANEL_Driver_Enable(touchIsrProc);
}

BOOL HAL_TOUCH_PANEL_Disable()
{
    return TOUCH_PANEL_Driver_Disable();
}

void HAL_TOUCH_PANEL_GetPoint(TOUCH_PANEL_SAMPLE_FLAGS* pTipState, int* pSource, int* pUnCalX, int* pUnCalY)
{
    TOUCH_PANEL_Driver_GetPoint(pTipState, pSource, pUnCalX, pUnCalY);
}

HRESULT HAL_TOUCH_PANEL_GetDeviceCaps(unsigned int iIndex, void* lpOutput)
{
    return TOUCH_PANEL_Driver_GetDeviceCaps(iIndex, lpOutput);
}
